Get Selector Position
AutomatR.Web.GetSelectorPosition
The "Get Selector Position" activity in AutomatR's Web Activities category retrieves the dimensions and position for a specified UI element. This information is valuable when you need to understand the location and size of a web element for precise automation.
Properties
Name | Description |
---|---|
Input | |
Element | Allows you to select the web element using the selector window. Use this property if you want to indicate the web element directly within the activity. |
WebElement | Specifies the UI Element variable identified by the "Find Element" or other activities. This allows you to use a previously identified web element in the workflow. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Get Selector Position" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
Timeout | Specifies the maximum time (in seconds) to wait for the activity to be executed before throwing an exception. Integer variables containing the timeout duration. The default timeout is set in the Constants.Timeout constant. |
Output | |
Position | Outputs a string containing the dimensions and position of the selected web element. The format of the string depends on the response received from the execution. Use a string variable to store the result for further processing within the workflow. |
How to use:
- Drag and drop the "Get Selector Position" activity onto the workflow.
- Configure the properties by choosing either the direct web element or providing a UI Element variable.
- Optionally, configure the delay and timeout based on your requirements.
- Create a string variable to store the position result (e.g., "elementPosition").
- Execute the workflow to obtain the dimensions and position of the specified web element.
Example: Consider an example where the "Get Selector Position" activity is used to retrieve the position of a button on a web page:
Get Selector Position:
Delay: 2
Timeout: 10
Element: Selector forButtonElement
Position: elementPosition
In this example, the activity waits for 2 seconds, has a timeout of 10 seconds, and captures the dimensions and position of the web element identified by the selector "forButtonElement." The result is stored in the "elementPosition" string variable for further use.